home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10748 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: munta.cs.mu.OZ.AU!trb
  2. From: trb@munta.cs.mu.OZ.AU (Timothy Robin BARBOUR)
  3. Newsgroups: comp.lang.c++
  4. Subject: g++ exception handling - help!
  5. Date: 10 Mar 1996 00:33:36 GMT
  6. Organization: Comp Sci, University of Melbourne
  7. Message-ID: <4ht810$cp8@mulga.cs.mu.OZ.AU>
  8. NNTP-Posting-Host: munta.cs.mu.oz.au
  9. Summary: turning on exception handling in g++ gives me link errors
  10. Keywords: g++, exceptions
  11.  
  12. I am using g++ 2.7.2 with ld 2.5.2.6 on a Linux 586-a.out box. When I turn on
  13. exception handling using the flag -fhandle-exceptions, I get link errors. These
  14. are of two kinds: undefined references to terminate(void) (which I fixed by 
  15. defining terminate, although surely it should be a standard function) and the 
  16. following:
  17.  
  18. ioserror.cpp(.text+0xf50): undefined reference to `L2657'
  19. ioserror.cpp(.text+0xf54): undefined reference to `L2658'
  20. ioserror.cpp(.text+0xf58): undefined reference to `L2659'
  21. starray.ti(.text+0xbcf4): undefined reference to `L12851
  22. starray.ti(.text+0xbcf8): undefined reference to `L12852'
  23. starray.ti(.text+0xbcfc): undefined reference to `L12853
  24. starray.ti(.text+0xbd00): undefined reference to `L13339
  25.  
  26. + lots more...
  27.  
  28. (the .ti files are for template instantiation, think of them as .cpp).
  29.  
  30. The above problem occurs for a program with about 10 small compilation units. I
  31. have been able to successfully throw and catch exceptions in a test program
  32. consisting of a *single compilation unit* (by defining terminate()).
  33.  
  34. The gcc info does not have any mention of exception handling (that I was able
  35. to find). Is there a special library that needs linking to support it ? BTW the
  36. places where the linker was complaining don't actually define or throw any 
  37. exceptions.
  38.  
  39. Any help would be greatly appreciated.
  40.  
  41.  
  42.